import React, { Component } from 'react';
import { View, Text, Alert } from 'react-native';
import { Actions } from 'react-native-router-flux';
import styles from './styles';
import Header from './components/header';
import LoginForm from './components/loginFrom';

export default class LoginWithPassword extends Component {
  submitHandle = values => {
    /* Alert.alert('表单值', JSON.stringify(values), [{ text: '知道了' }], {
      cancelable: false
    }); */
    Actions.main();
  };
  render() {
    return (
      <View>
        <Header
          title="登录"
          right={
            <Text style={styles.headerRight} onPress={() => Actions.registe()}>
              免费注册
            </Text>
          }
        />
        <View style={styles.content}>
          <LoginForm onSubmit={this.submitHandle} submitText="登录" />
          <View style={styles.otherOperate}>
            <Text
              onPress={() => {
                Actions.login();
              }}
            >
              使用短信验证码登录
            </Text>
            <Text onPress={() => Actions.findPassword()}>忘记密码?</Text>
          </View>
        </View>
      </View>
    );
  }
}
